package com;

import java.sql.SQLOutput;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        /**
        int nums = 3;
        String[] studentName = {"Zhangsan", "Lisi", "Wangwu"};
        int[] ages = {15, 16, 16};
        double[] mathScores = {80, 90, 95};
        double[] chineseScores = {85, 80, 90};

        double[] totalScores = new double[3];
        double[] averageScores = new double[3];
        char[] grade = new char[3];

        for (int i = 0; i < nums; i++) {
            totalScores[i] = mathScores[i] + chineseScores[i];
            averageScores[i] = totalScores[i] / 2;
            if (averageScores[i] >= 90) {
                grade[i] = 'A';
            } else if (averageScores[i] <= 89 && averageScores[i] >= 80) {
                grade[i] = 'B';
            } else if (averageScores[i] <= 79 && averageScores[i] >= 70) {
                grade[i] = 'C';
            } else if (averageScores[i] <= 69 && averageScores[i] >= 60) {
                grade[i] = 'D';
            } else {
                grade[i] = 'F';
            }

            System.out.println("Name：" + studentName[i] + ",Age:" + ages[i] + ",MathScores:" + mathScores[i] + ",ChineseScroes:" + chineseScores[i] + ",TotalScores:" + totalScores[i] + ",AverageScores:" + averageScores[i] + ",Grade:" + grade[i]);
        }

        //修改zhangsan的数学成绩
        int index = 0;
        mathScores[index] = 85;
        totalScores[index] = mathScores[index] + chineseScores[index];
        averageScores[index] = totalScores[index] / 2;
        if (averageScores[index] >= 90) {
            grade[index] = 'A';
        } else if (averageScores[index] <= 89 && averageScores[index] >= 80) {
            grade[index] = 'B';
        } else if (averageScores[index] <= 79 && averageScores[index] >= 70) {
            grade[index] = 'C';
        } else if (averageScores[index] <= 69 && averageScores[index] >= 60) {
            grade[index] = 'D';
        } else {
            grade[index] = 'F';
        }
        System.out.println("Changed Zhangsan's mathscores:");
        System.out.println("Name：" + studentName[index] + ",Age:" + ages[index] + ",MathScores:" + mathScores[index] + ",ChineseScroes:" + chineseScores[index] + ",TotalScores:" + totalScores[index] + ",AverageScores:" + averageScores[index] + ",Grade:" + grade[index]);
    **/
        Scanner in = new Scanner(System.in);
        int raw = in.nextInt();
        int col = in.nextInt();
        int jj=2;
        long sum = 0;
        for (int i = 0; i < raw; i++) {
            for (int j = 0; j < col; j++) {
                sum += in.nextInt();
            }
        }
        System.out.println(sum);
    }
}